<% if logged_in? %>
  <% if current_user.role == "admin" %>
    <h2>Mentors:</h2>

    <p><%= link_to 'Add Mentor', new_mentors_url %></p>
    <ul>
      <% for mentor in Mentor.find(:all) %>
        <li><%= "#{mentor.first_name} #{mentor.last_name}"%>
        <p><%= link_to 'Add mentorship', new_mentorships_url %></p>
        <ul>
          <% for mentee in mentor.mentees %>
            <li><%= mentee.first_name %></li>
          <% end %>
        </ul>
        </li>
      <% end %>
    </ul>

    <h2>Mentees:</h2>
    <p><%= link_to 'Add mentee', new_mentees_url %></p>
    <ul>
      <% for mentee in Mentee.find(:all) %>
        <li><%= "#{mentee.first_name} #{mentee.last_name}"%></li>
      <% end %>
    </ul>

    <h2>Mentorships:</h2>
    <p><%= link_to 'Add mentorship', new_mentorships_url %></p>
    <ul>
      <% for mentorship in Mentorship.find(:all) %>
        <li><%= "#{mentorship.mentee.first_name} : #{mentorship.mentor.first_name}"%></li>
      <% end %>
    </ul>
  <% elsif  current_user.role == "mentor" %>
    <p>Hi, mentor! Thanks for volunteering!</p>
  <% elsif current_user.role == "mentee" %>
    <p>Hi, mentor! Thanks for volunteering!</p>
  <% end %>
<% else %> 
  <p>Hi! You need to login first.</p>
  <p>Default users are admin/admin, mentor/mentor, mentee/mentee</p>
<% end %>
